package com.zn.loading
{
    import flash.events.Event;


    public class LoaderEvent extends Event
    {
        public static const PROGRESS:String = "progress";

        public static const LOADER_ITEM_UNLOAD_EVENT:String = "loaderItemUnloadEvent";

		public static const IO_ERROR:String = "ioError";
		
		public static const COMPLETE:String="complete";
		
		
        private var _currentLoader:LoaderItem;

        private var _bytesLoaded:int;

        private var _bytesTotal:int;

        private var _index:int;

        private var _total:int;

        public function LoaderEvent(type:String, currentLoader:LoaderItem = null, bytesLoaded:int = 0, bytesTotal:int = 0, index:int = 1, total:int = 1)
        {
            super(type, false, false);

            this._currentLoader = currentLoader;
            this._bytesLoaded = bytesLoaded;
            this._bytesTotal = bytesTotal;
            this._index = index;
            this._total = total;
        }

        public function get currentLoader():LoaderItem
        {
            return _currentLoader;
        }

        public function get bytesLoaded():int
        {
            return _bytesLoaded;
        }

        public function get bytesTotal():int
        {
            return _bytesTotal;
        }

        public function get index():int
        {
            return _index;
        }

        public function get total():int
        {
            return _total;
        }

        public override function clone():Event
        {
            return new LoaderEvent(type, currentLoader, bytesLoaded, bytesTotal, index, total);
        }

        public override function toString():String
        {
            return formatToString("LoaderEvent", "currentLoader", "bytesLoaded", "bytesTotal", "index", "total");
        }
    }
}
